using System;
using System.Collections.Generic;
using System.Text;
using DAL;
using Entities;

namespace BUS
{
    public class tbHangSanXuatBUS
    {
        public static void Insert_HangSanXuat(tbHangSanXuat hangsanxuat)
        {
            tbHangSanXuatDAL hangsanxuatDAL = new tbHangSanXuatDAL();
            hangsanxuatDAL.Insert(hangsanxuat);
        }
        public static void Update_HangSanXuat(tbHangSanXuat hangsanxuat)
        {
            tbHangSanXuatDAL hangsanxuatDAL = new tbHangSanXuatDAL();
            hangsanxuatDAL.Update(hangsanxuat);
        }
        public static void Delete_HangSanXuat(int iD)
        {
            tbHangSanXuatDAL hangsanxuatDAL = new tbHangSanXuatDAL();
            hangsanxuatDAL.Delete(iD);
        }
        public static Entities.tbHangSanXuat.tbHangSanXuatCollection Get(string where, int pageindex, int pagesize, string orderby, string orderdirection, out int total)
        {
            tbHangSanXuatDAL hangsanxuatDAL = new tbHangSanXuatDAL();
            return hangsanxuatDAL.Get(where, pageindex, pagesize, orderby, orderdirection, out total);
        }
        public static Entities.tbHangSanXuat.tbHangSanXuatCollection GetAll()
        {
            int total = 0;
            tbHangSanXuatDAL hangsanxuatDAL = new tbHangSanXuatDAL();
            return hangsanxuatDAL.Get("where 1=1", 0, 0, Entities.tbHangSanXuat.tbHangSanXuatColumns.IDHangSanXuat.ToString(), "ASC", out total);
        }
        public static tbHangSanXuat GetByID(int iD)
        {
            int total = 0;
            tbHangSanXuatDAL hangsanxuatDAL = new tbHangSanXuatDAL();
            Entities.tbHangSanXuat.tbHangSanXuatCollection hangsanxuatCollection = hangsanxuatDAL.Get("where " + Entities.tbHangSanXuat.tbHangSanXuatColumns.IDHangSanXuat.ToString() + "=" + iD.ToString(), 0, 0, Entities.tbHangSanXuat.tbHangSanXuatColumns.IDHangSanXuat.ToString(), "ASC", out total);
            if (hangsanxuatCollection.Count > 0)
                return hangsanxuatCollection[0];
            return null;
        }
    }
}
